package com.llt.blog.service;

import com.llt.blog.mapper.BlogMapper;
import com.llt.blog.model.BlogInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class BolgService {

    @Resource
    BlogMapper blogMapper;

    public List<BlogInfo> queryBlogList() {
        return blogMapper.selectAllBlog();
    }

    public BlogInfo queryBlogDetail(Integer blogId) {
        return blogMapper.selectById(blogId);
    }

    public Integer publishBlog(BlogInfo blogInfo) {
        return blogMapper.insertBlog(blogInfo);
    }

    public Integer updateBlog(BlogInfo blogInfo) {
        return blogMapper.updateBlog(blogInfo);
    }
}
